function nameList = extractLHIImageName(path)
% test case:
% nameList = extractLHIImageName('D:\Datasets\CarImages\LHIHightTilt')
str = computer('arch');
if strcmp(str,'win64') ||strcmp(str,'win32')
    case_sensitive = false;
else
    case_sensitive = true;
end

pathList = dir(path);
nameList = struct('path',{},'name',{});
for iPath = 1:length(pathList)
    if ~pathList(iPath).isdir || strcmp(pathList(iPath).name, '.')|| ...
            strcmp(pathList(iPath).name,'..');
        continue;
    end
    img_path =dir( [path '/' pathList(iPath).name '/' ]);
    noPath = true;
    for jPath = 1:length(img_path)
        if isempty(regexp(img_path(jPath).name,'[\s]*[S|s]cale[\s]*2', 'once'));
            continue;
        else
            noPath = false;
            tmp.path =  [path '/' pathList(iPath).name '/' img_path(jPath).name ];
            if case_sensitive
                name_list_jpg = dir([tmp.path '/*.jpg']);
                name_list_bmp = dir([tmp.path '/*.JPG']);
                name_list = [name_list_jpg;name_list_bmp];
            else
                name_list= dir([tmp.path '/*.jpg']);
            end
            if isempty(name_list)
                disp('warning, can not find jpg format image in:');
                disp(tmp.path)
            else
                tmp.name = name_list.name;
                nameList = [nameList;tmp];
                continue;
            end
        end
    end
    if noPath
        disp(['warning: can not find proper image path in: '])
        disp( [path '/' pathList(iPath).name '/' ]);
    end
end
